package population.populationFindPredicates;

import character.Character;

/**
 * Find individuals in certain age range.
 * @author pcdejager
 *
 */
public class FindAgeRange implements PopulationFindPredicate {

    /**
     * Constructor.
     * @param min Minimum age
     * @param max Maximum age
     */
    public FindAgeRange(final int min, final int max) {
        minimum = min;
        maximum = max;
    }

    /**
     * Check character.
     * @param c The character to check against range
     * @return True if conditions met, else false
     */
    public final boolean check(final Character c) {
        int age = c.getAge().years();
        if ((age >= minimum) && (age <= maximum)) {
            return true;
        }
        return false;
    }

    /**
     * The minimum age.
     */
    private int minimum;
    /**
     * The maximum age.
     */
    private int maximum;
}
